<template>
	<view style="">
		<view class="plan-book-list" @click="clickCard">
			<view class="plan-book" :style="'background-color:' + info.bg_color">
				<view class="plan-book-text">
					<text class="plan-book-title">{{info.planName}}</text>
					<text class="plan-book-info">{{info.planKind=='0'?'个人计划':'共同计划'}}</text>
					<text class="plan-book-info">{{info.planDescription.length>13?info.planDescription.slice(0,13)+'...':info.planDescription}}</text>
				</view>
				<view class="plan-book-btn">
					<y-button @click.stop="clickBtn" v-if="info.isClocked=='0'" content="打卡" styleValue="background-color: #fff;color:#6D39E9;width: 100%;font-size: 24rpx;padding:5rpx 10rpx;height:45rpx;box-shadow:none;"></y-button>
					<y-button v-if="info.isClocked=='1'" content="已打卡" styleValue="background: rgba(0,0,0,0.10);color:#fff;width: 100%;font-size: 24rpx;padding:5rpx 10rpx;height:45rpx;box-shadow:none;"></y-button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
		props:['info','index'],
		methods:{
			clickBtn(){
				this.$emit('clickBtn',{info:this.info,index:this.index});
			},
			clickCard(){
				this.$emit('clickCard',{info:this.info,index:this.index});
			}
			
		}
	}
</script>

<style lang="scss">

.plan-book-list{
	display: flex;
	width: 100%;
	padding: 47rpx 15rpx;
	justify-content: flex-start;
	.plan-book{
		width: 232rpx;
		height: 283rpx;
		background: #ffebd5;
		border-radius: 18rpx;
		box-shadow: 0rpx 13rpx 25rpx 0rpx rgba(28,97,189,0.10); 
		padding: 22rpx;
		position: relative;
		text{
			display: block;
		}
		.plan-book-title{
			font-size: 25rpx;
			font-weight: 700;
			color: #6d39e9;
		}
		.plan-book-info{
			font-size: 22rpx;
			font-weight: 500;
			color: rgba(109,57,233,0.80);
		}
		.plan-book-btn{
			position: absolute;
			bottom: 40rpx;
			width: 188rpx;
			// margin-top: 60rpx;
			height: 33rpx;
		}
	}
}
</style>
